package com.chalk.common.constant;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xiaoqiang
 * @Description 积分规则配置
 * @date 2019/4/30 10:50
 */
@Component
public class PointsRuleConstants {

    /* 积分增加次数设置 */
    public static final int COUNT_NUM = 3;

    /* 签到ID */
    public static final String SIGNING_ID = "1122385969073438722";
    /* 发帖ID */
    public static final String SEND_NEWS = "1126014673645285377";
    /* 帖子被设为热帖ID */
    public static final String TOP_NEWS = "1126014854298152962";
    /* 评论ID */
    public static final String COMMENT = "1126014948665798657";
    /* 评论被设为热评ID */
    public static final String TOP_COMMENT = "1126015377495633922";
    /* 分享ID */
    public static final String SHARE = "1126015818493145090";
    /* 被删帖ID */
    public static final String DELETE_NEWS = "1126015899271245825";
    /* 被删评论ID */
    public static final String DELETE_COMMENT = "1126016034671767553";

    /**
     * 根据积分业务类型获取积分规则ID
     * @param key(积分业务类型)
     * @return
     */
    public String getRuleId(Integer key){
        Map<Integer, String> map = new HashMap<>(8);
        map.put(0, SIGNING_ID);
        map.put(1, SEND_NEWS);
        map.put(2, TOP_NEWS);
        map.put(3, COMMENT);
        map.put(4, TOP_COMMENT);
        map.put(5, SHARE);
        map.put(6, DELETE_NEWS);
        map.put(7, DELETE_COMMENT);
        return map.get(key);
    }

}
